package lab2Exercise1;

public class StackTest {
	
	public static void main (String [] args)
	{
		ArrayStack<String> stack1 = new ArrayStack<String>(3);
		String one = new String("One");
		String two = new String("Two");
		String three = new String("Three");
		String four = new String("Four");
		stack1.push(one);
		stack1.push(two);
		stack1.push(three);
		stack1.push(four);
		System.out.println(stack1.pop()+ stack1.pop() + stack1.pop() + stack1.pop());
		String[] test = {"Hello", "Dear", "Feel", "Me"};
		reverse(test);

	}
	
	public static void reverse (String[] arr)
	{
		ArrayStack<String> stack = new ArrayStack<String>(arr.length);
		for(String item : arr) {
			stack.push(item);
		}
		for (int i = 0; i < arr.length;i ++) {
			arr[i] = stack.pop();
		}
		for(String i : arr) {
			System.out.println(i);
		}
	}

}
